package models

// AlarmNotifyRecord 告警通知的日志
type AlarmNotifyRecord struct {
	ID           string  `json:"id" gorm:"column:id;primaryKey;type:int;size:64;comment:主键id"`
	RobotID      string  `json:"robot_id" gorm:"column:robot_id;type:string;size:40;index:idx_robotID_createdDate,priority:1;comment:机器人ID"`
	SetUser      string  `json:"set_user" gorm:"column:set_user;type:string;size:40;comment:设置告警的用户名"`
	MapName      string  `json:"map_name" gorm:"column:map_name;type:string;size:40;comment:地图名称"`
	PosX         float64 `json:"pos_x" gorm:"column:pos_x;type:float;size:64;comment:机器的位置x"`
	PosY         float64 `json:"pos_y" gorm:"column:pos_y;type:float;size:64;comment:机器的位置y"`
	PosDirection float64 `json:"pos_direction" gorm:"column:pos_direction;type:float;size:64;comment:机器的位置朝向"`
	AlarmSource  int     `json:"alarm_source" gorm:"column:alarm_source;type:int;size:32;commnet:告警来源"`
	AlarmType    int     `json:"alarm_type" gorm:"column:alarm_type;type:int;size:32;comment:告警类型"`
	MsgContent   string  `json:"msg_content" gorm:"column:msg_content;type:string;size:1024;comment:告警信息"`
	CreatedDate  string  `json:"created_date,omitempty" gorm:"column:created_date;type:string;size:10;index:idx_robotID_createdDate,priority:2;comment:告警日期"`
	CreatedAt    int64   `json:"created_at" gorm:"column:created_at;autoCreateTime;type:int;size:64;index:created_at;comment:告警发生时间"`
	ReportedAt   int64   `json:"reported_at" gorm:"column:reported_at;type:int;size:64;autoCreateTime;comment:告警上报时间"`
}

// TableName 指定表名
func (AlarmNotifyRecord) TableName() string {
	return "alarm_notify_record"
}

// 模式自动注册
func init() {
	Models = append(Models, &AlarmNotifyRecord{})
}

type AlarmNotifyRecordTpl struct {
	AlarmNotifyRecord
}

func (AlarmNotifyRecordTpl) TableName() string {
	return "alarm_notify_record_tpl"
}
func (AlarmNotifyRecordTpl) Unimplemented() {

}
